<template>
  <div class="index-ads">
    <div class="container">
      <div v-for="(item, index) in sildeList" :key="index" class="ad-item">
        <img v-lazy="item.imgUrl" alt="" @click="adItemClick(item.id)"/>
        <!-- <div class="ad-pop">
          <span>{{item.goodsName}}</span><span>售价：{{item.sellPrice}}元</span>
        </div> -->
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "indexAds",
  data() {
    return {
    };
  },
  props: {
    sildeList: {
      type: Array,
      default: []
    }
  },
  methods: {
    adItemClick(id) {
      this.$router.push("/detail/" + id)
    },
  },
};
</script>
<style scoped>
.index-ads {
  margin-top: 30px;
}
.container {
  width: 100%;
  display: flex;
  flex-flow: row nowrap;
  
  /* justify-content: space-between; */
  align-items: center;
}
.ad-item {
  flex: 0 1 250px;
  box-sizing: border-box;
  margin-right: 10%;
}
.ad-item img {
  width: 250px;
  height: 160px;
}
.ad-item .ad-pop{
  height: 30px;
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.ad-item .ad-pop span{
  width: 50%;
  color: #f20a0a;
  text-align: center;
  line-height: 30px;
  font-size: 14px;
  font-weight: 600;
}
</style>
